import Taro, { Component } from '@tarojs/taro'
import { View, Text, ScrollView } from '@tarojs/components'
import styles from './index.module.scss'
import classNames from 'classnames'
import head from 'lodash/head'
import GoodsTwo from "@/components/custom-layout/goods-two";
import {LoadMore, Version} from "@/components/index";
import {getCount, getPage} from "@/api/productApi";
import {getRandomPage, getRandomPageNumber} from "@/utils/storage";

/**
 * 商品分类
 * @param list 分类列表
 */

export default class Index extends Component {
  props: any
  state: any

  constructor() {
    super(...arguments)
    this.state = {
      tabKey: '',
      productList: [],
      loadStatus: 'loading',
      page: 1,
      totalCount: 0
    }
  }

  componentDidMount() {
    this.setState({
      tabKey: this.props['list'][0].url
    }, () => {
      getCount({categoryId: this.state.tabKey || undefined} ).then(() => {
        this.getList()
      })
    })
  }

  render() {
    const { tabKey, productList, loadStatus } = this.state
    const { list=[] } = this.props
    return (<View>
      活动版块
    </View>)
  }
}
